|
In arithmetic and computer programming, the extended Euclidean algorithm is an extension to the Euclidean algorithm, which computes, besides the greatest common divisor of integers ''a'' and ''b'', the coefficients of Bézout's identity, that is integers ''x'' and ''y'' such that : It allows one to compute also, with almost no extra cost, the quotients of ''a'' and ''b'' by their greatest common divisor. Extended Euclidean algorithm also refers to a very similar algorithm for computing the polynomial greatest common divisor and the coefficients of Bézout's identity of two univariate polynomials. The extended Euclidean algorithm is particularly useful when ''a'' and ''b'' are coprime, since ''x'' is the modular multiplicative inverse of ''a'' modulo ''b'', and ''y'' is the modular multiplicative inverse of ''b'' modulo ''a''. Similarly, the polynomial extended Euclidean algorithm allows one to compute the multiplicative inverse in algebraic field extensions and, in particular in finite fields of non prime order. It follows that both extended Euclidean algorithms are widely used in cryptography. In particular, the computation of the modular multiplicative inverse is an essential step in RSA public-key encryption method. == Description== The standard Euclidean algorithm proceeds by a succession of Euclidean divisions whose quotients are not used, only the ''remainders'' are kept. For the extended algorithm, the successive quotients are used. More precisely, the standard Euclidean algorithm with ''a'' and ''b'' as input, consists of computing a sequence of quotients and a sequence of remainders such that : It is the main property of Euclidean division that the inequalities on the right define uniquely from and The computation stops when one reaches a remainder which is zero; the greatest common divisor is then the last non zero remainder The extended Euclidean algorithm proceeds similarly, but adds two other sequences, as follows : The computation also stops when and gives * is the greatest common divisor of the input and * The Bézout coefficients are and that is * The quotients of ''a'' and ''b'' by their greatest common divisor are given by and Moreover, if ''a'' and ''b'' are both positive, we have : This means that the pair of Bézout's coefficients provided by the extended Euclidean algorithm is one of the two minimal pairs of Bézout coefficients. 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Extended Euclidean algorithm」の詳細全文を読む スポンサード リンク
|